<?php
   
   class MyDB extends SQLite3
   {
      function __construct()
      {  
      $dbname=$_POST['dbname'];
        echo $dbname."<br>";
         $this->open($dbname);
      }
   }
   $db = new MyDB();
   if(!$db){
      echo $db->lastErrorMsg();
   } else {
      echo "Opened database successfully\n";
   }
  $sql =<<<EOF
      SELECT * from 玩家背包;
EOF;
   
   echo "<table border='2'>
<tr>
<th>QQ</th>
<th>物品</th>
<th>数量</th>
</tr>";


$ret = $db->query($sql);
   while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
      echo "<tr>";
      echo "<td>". $row['QQ'] . "</td>\n";
      echo "<td>". $row['物品'] ."</td>\n";
      echo "<td>". $row['数量'] ."</td>\n";
      echo "</tr>";
   }
   echo "</table>";
   echo "Operation done successfully\n";
   $db->close();
?>